<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
    <style>
        .square{
            width: 100px;
            height: 100px;
            background-color:tomato;
        }
        .ball{
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background-color:springgreen;
        }
    </style>
</head>
<body>
    <div id="root">
        <div :class="dynicCls" @click="change"></div>
    </div>
    <script>
        new Vue({
            el:'#root',
            data(){
                return{
                    dynicCls:'square'
                }
            },
            methods: {
                change(){
                    if(this.dynicCls=="square"){
                        this.dynicCls="ball"
                    }else if(this.dynicCls=="ball"){
                        this.dynicCls="square"
                    }
                }
            },
        })
    </script>
</body>
</html>